
Partial Class Login
    Inherits System.Web.UI.Page

    Protected Sub Login1_LoginError(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim Login1 As WebControls.Login
        Login1 = LoginView1.FindControl("Login1")
        Dim user As MembershipUser = Membership.GetUser(Login1.UserName)
        Login1.FailureText = "Your login attempt was not successful. Please try again."
        If user IsNot Nothing Then
            If user.IsLockedOut Then
                Login1.FailureText = "This account has been locked. Please contact the web administrator."
            End If
        End If
    End Sub

End Class
